and fix a related bug.
Note that we incorrectly, for kml:dateTimeType, force values
without time zone qualifiers to UTC.
We do not test the optional gYearMonth time zone qualifer.
We do not test the optional gYear time zone qualifer.
We do not test the optional date time zone qualifer.
*pointstr = '\0';
}
- int year = 0, mon = 0, mday = 0, hour = 0, min = 0, sec = 0;
+ int year = 0, mon = 1, mday = 1, hour = 0, min = 0, sec = 0;
gpsbabel::DateTime dt;
int res = sscanf(timestr, "%d-%d-%dT%d:%d:%d", &year, &mon, &mday, &hour,
&min, &sec);
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
+ <Document>
+ <Placemark>
+ <name>gYear (YYYY)</name>
+ <TimeStamp>
+ <when>1997</when>
+ </TimeStamp>
+ <Point>
+ <coordinates>-116.865460,36.460850,-55.60</coordinates>
+ </Point>
+ </Placemark>
+ <Placemark>
+ <name>gYearMonth (YYYY-MM)</name>
+ <TimeStamp>
+ <when>1997-07</when>
+ </TimeStamp>
+ <Point>
+ <coordinates>-116.865460,36.460850,-55.60</coordinates>
+ </Point>
+ </Placemark>
+ <Placemark>
+ <name>date (YYYY-MM-DD)</name>
+ <TimeStamp>
+ <when>1997-07-16</when>
+ </TimeStamp>
+ <Point>
+ <coordinates>-116.865460,36.460850,-55.60</coordinates>
+ </Point>
+ </Placemark>
+ <Placemark>
+ <name>dateTime (YYYY-MM-DDThh:mm:ssZ)</name>
+ <TimeStamp>
+ <when>1997-07-16T07:30:15Z</when>
+ </TimeStamp>
+ <Point>
+ <coordinates>-116.865460,36.460850,-55.60</coordinates>
+ </Point>
+ </Placemark>
+ <Placemark>
+ <name>dateTime (YYYY-MM-DDThh:mm:sszzzzzz)</name>
+ <TimeStamp>
+ <when>1997-07-16T10:30:15+03:00</when>
+ </TimeStamp>
+ <Point>
+ <coordinates>-116.865460,36.460850,-55.60</coordinates>
+ </Point>
+ </Placemark>
+ </Document>
+</kml>
--- /dev/null
+No,Latitude,Longitude,Name,Altitude,Date,Time\r
+1,36.460850,-116.865460,"gYear (YYYY)",-55.6,1997/01/01,00:00:00\r
+2,36.460850,-116.865460,"gYearMonth (YYYY-MM)",-55.6,1997/07/01,00:00:00\r
+3,36.460850,-116.865460,"date (YYYY-MM-DD)",-55.6,1997/07/16,00:00:00\r
+4,36.460850,-116.865460,"dateTime (YYYY-MM-DDThh:mm:ssZ)",-55.6,1997/07/16,07:30:15\r
+5,36.460850,-116.865460,"dateTime (YYYY-MM-DDThh:mm:sszzzzzz)",-55.6,1997/07/16,07:30:15\r
compare ${REFERENCE}/track/92GV66G1.igc.kml ${TMPDIR}/92GV66G1.igc.kml
gpsbabel -i igc -f ${REFERENCE}/track/92HV66G1.igc -o kml,floating=1,track=1,points=0 -F ${TMPDIR}/92HV66G1.igc.kml
compare ${REFERENCE}/track/92HV66G1.igc.kml ${TMPDIR}/92HV66G1.igc.kml
+
+# verify kml:dateTimeType parsing
+gpsbabel -i kml -f ${REFERENCE}/xsddatetime.kml -o unicsv,utc -F ${TMPDIR}/xsddatetime~kml.csv
+compare ${REFERENCE}/xsddatetime~kml.csv ${TMPDIR}/xsddatetime~kml.csv
+